<?php
namespace statistics;
/******************************************************************************
 * Statistiken
 *
 * Beta Version
 *
 * Dieses Plugin ermöglicht das Erstellen von Statistiken aus den Profildaten
 * der angemeldeten Benutzer. Konfigurierte Statistiken können gespeichert,
 * geladen und angezeigt werden.
 *
 *  
 * Copyright    : (c) 2004 - 2012 The Admidio Team
 * Homepage     : http://www.admidio.org
 * License      : GNU Public License 2 http://www.gnu.org/licenses/gpl-2.0.html
 * 
 * 
 *****************************************************************************/
require_once (substr ( __DIR__, 0, strpos ( __DIR__, 'statistics' ) + 10 ) . DIRECTORY_SEPARATOR . 'includes.php');
use statistics\utils\AccessControlManager;

define ( 'LINK_TEXT_INSTALLATION', 'Installation / Deinstallation' );
define ( 'LINK_TEXT_OVERWIEW', 'Statistiken' );
define ( 'LINK_TEXT_CONFIG', 'Statistikeditor' );

$acm = AccessControlManager::getInstance();

if ($acm->checkUserHasAnyPlgs()) {
	echo '<div id="plugin_statistics" class="admPluginContent">
            <div class="admPluginHeader"><h3>Statistiken</h3></div>
                <div class="admPluginBody">';
	
	if ($acm->checkUserPrivilege(AccessControlManager::SHOW_PRIVILEGE)) {
		echo ' <span class="menu">
                    <a href="' . STATISTICS_WEB_ROOT . '/view/overview.php"><img
                        style="vertical-align: middle;" src="' . THEME_PATH . '/icons/lists.png" alt="' . LINK_TEXT_OVERWIEW . '" title="' . LINK_TEXT_OVERWIEW . '" /></a>
                    <a href="' . STATISTICS_WEB_ROOT . '/view/overview.php">' . LINK_TEXT_OVERWIEW . '</a>
                </span>';
	}
	
	if ($acm->checkUserPrivilege(AccessControlManager::CONFIG_PRIVILEGE)) {
		echo ' <span class="menu">
                    <a href="' . STATISTICS_WEB_ROOT . '/controller/editor/editor.php"><img
                        style="vertical-align: middle;" src="' . THEME_PATH . '/icons/options.png" alt="' . LINK_TEXT_CONFIG . '" title="' . LINK_TEXT_CONFIG . '" /></a>
                    <a href="' . STATISTICS_WEB_ROOT . '/controller/editor/editor.php">' . LINK_TEXT_CONFIG . '</a>
                </span>';
	}
	
	if ($acm->checkUserPrivilege(AccessControlManager::INSTALL_PRIVILEGE)) {
		echo ' <span class="menu">
                    <a href="' . STATISTICS_WEB_ROOT . '/view/install.php"><img
                        style="vertical-align: middle;" src="' . THEME_PATH . '/icons/backup.png" alt="' . LINK_TEXT_INSTALLATION . '" title="' . LINK_TEXT_INSTALLATION . '" /></a>
                    <a href="' . STATISTICS_WEB_ROOT . '/view/install.php">' . LINK_TEXT_INSTALLATION . '</a>
                </span>';
	}
	
	echo '</div>
        </div>';
}

?>

